﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    [Serializable]
    [DataContract] 
    public class BianZhiModel
    {
        private bool isselected = false;
        [DataMember]
        public bool IsSelected
        {
            get { return isselected; }
            set { isselected = value; }
        }

        private bool _ZhengKeLingDaoTC = false;
        [DataMember]
        public bool ZhengKeLingDaoTC
        {
            get { return _ZhengKeLingDaoTC; }
            set { _ZhengKeLingDaoTC = value; }
        }

        private bool _ZhengKeFeiLingDaoTC = false;
        [DataMember]
        public bool ZhengKeFeiLingDaoTC
        {
            get { return _ZhengKeFeiLingDaoTC; }
            set { _ZhengKeFeiLingDaoTC = value; }
        }

        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        private string _TCMC;
        [DataMember]
        public string TCMC
        {
            get { return _TCMC; }
            set { _TCMC = value; }
        }

        private string _TCMC1;
        [DataMember]
        public string TCMC1
        {
            get { return _TCMC1; }
            set { _TCMC1 = value; }
        }

        private string _JiGouMingCheng;
        [DataMember]
        public string JiGouMingCheng
        {
            get { return _JiGouMingCheng; }
            set { _JiGouMingCheng = value; }
        }

        private string _JiGuanXingZheng;
        [DataMember]
        public string JiGuanXingZheng
        {
            get { return _JiGuanXingZheng; }
            set { _JiGuanXingZheng = value; }
        }

        private string _ZhengFaXingZheng;
        [DataMember]
        public string ZhengFaXingZheng
        {
            get { return _ZhengFaXingZheng; }
            set { _ZhengFaXingZheng = value; }
        }

        private string _CanZhaoGuanLi;
        [DataMember]
        public string CanZhaoGuanLi
        {
            get { return _CanZhaoGuanLi; }
            set { _CanZhaoGuanLi = value; }
        }

        private string _ShiZhiHeJi;
        [DataMember]
        public string ShiZhiHeJi
        {
            get { return _ShiZhiHeJi; }
            set { _ShiZhiHeJi = value; }
        }

        private int _OrgID;
        [DataMember]
        public int OrgID
        {
            get { return _OrgID; }
            set { _OrgID = value; }
        }

        private string _ZongBianZhi;
        [DataMember]
        public string ZongBianZhi
        {
            get { return _ZongBianZhi; }
            set { _ZongBianZhi = value; }
        }
        
        private string _ZongBianZhiShiYou;
        [DataMember]
        public string ZongBianZhiShiYou
        {
            get { return _ZongBianZhiShiYou; }
            set { _ZongBianZhiShiYou = value; }
        }
        /// <summary>
        /// 乡科级正职核定数
        /// </summary>
        private string _ZhengKeLingDao;
        [DataMember]
        public string ZhengKeLingDao
        {
            get { return _ZhengKeLingDao; }
            set { _ZhengKeLingDao = value; }
        }

        private string _ZhengKeLingDaoShiYou;
        [DataMember]
        public string ZhengKeLingDaoShiYou
        {
            get { return _ZhengKeLingDaoShiYou; }
            set { _ZhengKeLingDaoShiYou = value; }
        }
        /// <summary>
        /// 乡科级副职核定数
        /// </summary>
        private string _ZhengKeFeiLingDao;
        [DataMember]
        public string ZhengKeFeiLingDao
        {
            get { return _ZhengKeFeiLingDao; }
            set { _ZhengKeFeiLingDao = value; }
        }

        private string _ZhengKeFeiLingDaoShiYou;
        [DataMember]
        public string ZhengKeFeiLingDaoShiYou
        {
            get { return _ZhengKeFeiLingDaoShiYou; }
            set { _ZhengKeFeiLingDaoShiYou = value; }
        }
        /// <summary>
        /// 主任科员
        /// </summary>
        private string _FuKeLingDao;
        [DataMember]
        public string FuKeLingDao
        {
            get { return _FuKeLingDao; }
            set { _FuKeLingDao = value; }
        }

        private string _FuKeLingDaoS;
        [DataMember]
        public string FuKeLingDaoS
        {
            get { return _FuKeLingDaoS; }
            set { _FuKeLingDaoS = value; }
        }

        private string _FuKeLingDaoShiYou;
        [DataMember]
        public string FuKeLingDaoShiYou
        {
            get { return _FuKeLingDaoShiYou; }
            set { _FuKeLingDaoShiYou = value; }
        }
        /// <summary>
        /// 副主任科员
        /// </summary>
        private string _FuKeFeiLingDao;
        [DataMember]
        public string FuKeFeiLingDao
        {
            get { return _FuKeFeiLingDao; }
            set { _FuKeFeiLingDao = value; }
        }

        private string _FuKeFeiLingDaoS;
        [DataMember]
        public string FuKeFeiLingDaoS
        {
            get { return _FuKeFeiLingDaoS; }
            set { _FuKeFeiLingDaoS = value; }
        }

        private string _FuKeFeiLingDaoShiYou;
        [DataMember]
        public string FuKeFeiLingDaoShiYou
        {
            get { return _FuKeFeiLingDaoShiYou; }
            set { _FuKeFeiLingDaoShiYou = value; }
        }

        private string _KeYuan;
        [DataMember]
        public string KeYuan
        {
            get { return _KeYuan; }
            set { _KeYuan = value; }
        }

        private string _KeYuanShiYou;
        [DataMember]
        public string KeYuanShiYou
        {
            get { return _KeYuanShiYou; }
            set { _KeYuanShiYou = value; }
        }

        private string _WeiDingZhi;
        [DataMember]
        public string WeiDingZhi
        {
            get { return _WeiDingZhi; }
            set { _WeiDingZhi = value; }
        }

        private string _OrgName;
        [DataMember]
        public string OrgName
        {
            get { return _OrgName; }
            set { _OrgName = value; }
        }

        private string _ChuJiRenShu;
        [DataMember]
        public string ChuJiRenShu
        {
            get { return _ChuJiRenShu; }
            set { _ChuJiRenShu = value; }
        }

        private string _KeYiXiaRenShu;
        [DataMember]
        public string KeYiXiaRenShu
        {
            get { return _KeYiXiaRenShu; }
            set { _KeYiXiaRenShu = value; }
        }

        private string _ZhengKeLingDaoString;
        [DataMember]
        public string ZhengKeLingDaoString
        {
            get { return _ZhengKeLingDaoString; }
            set { _ZhengKeLingDaoString = value; }
        }

        private string _ZhengKeFeiLingDaoString;
        [DataMember]
        public string ZhengKeFeiLingDaoString
        {
            get { return _ZhengKeFeiLingDaoString; }
            set { _ZhengKeFeiLingDaoString = value; }
        }


        private string _ZongShu;
        [DataMember]
        public string ZongShu
        {
            get { return _ZongShu; }
            set { _ZongShu = value; }
        }
        private string _JuXianChu;
        [DataMember]
        public string JuXianChu
        {
            get { return _JuXianChu; }
            set { _JuXianChu = value; }
        }
        private string _XiangKeZhengFuZ;
        [DataMember]
        public string XiangKeZhengFuZ
        {
            get { return _XiangKeZhengFuZ; }
            set { _XiangKeZhengFuZ = value; }
        }
        private string _QingKuangMiaoShu;
        [DataMember]
        public string QingKuangMiaoShu
        {
            get { return _QingKuangMiaoShu; }
            set { _QingKuangMiaoShu = value; }
        }

        #region 新
        private string _canzhaocount;
        [DataMember]
        public string canzhaocount
        {
            get { return _canzhaocount; }
            set { _canzhaocount = value; }
        }
        private string _xingzhengcount;
        [DataMember]
        public string xingzhengcount
        {
            get { return _xingzhengcount; }
            set { _xingzhengcount = value; }
        }
        private string _zhengfacount;
        [DataMember]
        public string zhengfacount
        {
            get { return _zhengfacount; }
            set { _zhengfacount = value; }
        }
        private string _chujicount;
        [DataMember]
        public string chujicount
        {
            get { return _chujicount; }
            set { _chujicount = value; }
        }
        private string _kejicount;
        [DataMember]
        public string kejicount
        {
            get { return _kejicount; }
            set { _kejicount = value; }
        }
        private string _keyuancount;
        [DataMember]
        public string keyuancount
        {
            get { return _keyuancount; }
            set { _keyuancount = value; }
        }
        private string _weidingjicount;
        [DataMember]
        public string weidingjicount
        {
            get { return _weidingjicount; }
            set { _weidingjicount = value; }
        }
        private string _weiguoducount;
        [DataMember]
        public string weiguoducount
        {
            get { return _weiguoducount; }
            set { _weiguoducount = value; }
        }
        private string _zongcount;
        [DataMember]
        public string zongcount
        {
            get { return _zongcount; }
            set { _zongcount = value; }
        }
        private string _chaobian;
        [DataMember]
        public string chaobian
        {
            get { return _chaobian; }
            set { _chaobian = value; }
        }
        private string _kongbian;
        [DataMember]
        public string kongbian
        {
            get { return _kongbian; }
            set { _kongbian = value; }
        }
        private string _kongbianlv;
        [DataMember]
        public string kongbianlv
        {
            get { return _kongbianlv; }
            set { _kongbianlv = value; }
        }
        private string _canzhaoshiyoucount;
        [DataMember]
        public string canzhaoshiyoucount
        {
            get { return _canzhaoshiyoucount; }
            set { _canzhaoshiyoucount = value; }
        }
        private string _JieYongQingKuang;
        [DataMember]
        public string ZhengKeJieYongQingKuang
        {
            get { return _JieYongQingKuang; }
            set { _JieYongQingKuang = value; }
        }
        private bool _IsTongKeShiJieYong;
        [DataMember]
        public bool IsZhengKeTongKeShiJieYong
        {
            get { return _IsTongKeShiJieYong; }
            set { _IsTongKeShiJieYong = value; }
        }
        private string _IsTongKeShiJieYongS;
        [DataMember]
        public string IsZhengKeTongKeShiJieYongS
        {
            get { return _IsTongKeShiJieYongS; }
            set { _IsTongKeShiJieYongS = value; }
        }
        private string _JieYongDutyID;
        [DataMember]
        public string ZhengKeJieYongDutyID
        {
            get { return _JieYongDutyID; }
            set { _JieYongDutyID = value; }
        }

        private string _FuKeJieYongQingKuang;
        [DataMember]
        public string FuKeJieYongQingKuang
        {
            get { return _FuKeJieYongQingKuang; }
            set { _FuKeJieYongQingKuang = value; }
        }
        private bool _IsFuKeTongKeShiJieYong;
        [DataMember]
        public bool IsFuKeTongKeShiJieYong
        {
            get { return _IsFuKeTongKeShiJieYong; }
            set { _IsFuKeTongKeShiJieYong = value; }
        }
        private string _IsFuKeTongKeShiJieYongS;
        [DataMember]
        public string IsFuKeTongKeShiJieYongS
        {
            get { return _IsFuKeTongKeShiJieYongS; }
            set { _IsFuKeTongKeShiJieYongS = value; }
        }
        private string _FuKeJieYongDutyID;
        [DataMember]
        public string FuKeJieYongDutyID
        {
            get { return _FuKeJieYongDutyID; }
            set { _FuKeJieYongDutyID = value; }
        }

        private string _ZhuRenJieYongQingKuang;
        [DataMember]
        public string ZhuRenJieYongQingKuang
        {
            get { return _ZhuRenJieYongQingKuang; }
            set { _ZhuRenJieYongQingKuang = value; }
        }
        private string _ZhuRenJieYongDutyID;
        [DataMember]
        public string ZhuRenJieYongDutyID
        {
            get { return _ZhuRenJieYongDutyID; }
            set { _ZhuRenJieYongDutyID = value; }
        }

        private string _FuZhuRenJieYongQingKuang;
        [DataMember]
        public string FuZhuRenJieYongQingKuang
        {
            get { return _FuZhuRenJieYongQingKuang; }
            set { _FuZhuRenJieYongQingKuang = value; }
        }
        private string _FuZhuRenJieYongDutyID;
        [DataMember]
        public string FuZhuRenJieYongDutyID
        {
            get { return _FuZhuRenJieYongDutyID; }
            set { _FuZhuRenJieYongDutyID = value; }
        }

        private string _zhengkeshiyou;
        [DataMember]
        public string zhengkeshiyou
        {
            get { return _zhengkeshiyou; }
            set { _zhengkeshiyou = value; }
        }
        private string _zhengkejianren;
        [DataMember]
        public string zhengkejianren
        {
            get { return _zhengkejianren; }
            set { _zhengkejianren = value; }
        }
        private string _fukeshiyou;
        [DataMember]
        public string fukeshiyou
        {
            get { return _fukeshiyou; }
            set { _fukeshiyou = value; }
        }
        private string _fukejianren;
        [DataMember]
        public string fukejianren
        {
            get { return _fukejianren; }
            set { _fukejianren = value; }
        }
        private string _zhurenshiyou;
        [DataMember]
        public string zhurenshiyou
        {
            get { return _zhurenshiyou; }
            set { _zhurenshiyou = value; }
        }
        private string _fuzhurenshiyou;
        [DataMember]
        public string fuzhurenshiyou
        {
            get { return _fuzhurenshiyou; }
            set { _fuzhurenshiyou = value; }
        }
        private string _CanUse;
        [DataMember]
        public string CanUse
        {
            get { return _CanUse; }
            set { _CanUse = value; }
        }
        private string _Demo;
        [DataMember]
        public string Demo
        {
            get { return _Demo; }
            set { _Demo = value; }
        }
        private string _JieRuJieChu;
        [DataMember]
        public string JieRuJieChu
        {
            get { return _JieRuJieChu; }
            set { _JieRuJieChu = value; }
        }

        private string _ZhengKeShiJi;
        [DataMember]
        public string ZhengKeShiJi
        {
            get { return _ZhengKeShiJi; }
            set { _ZhengKeShiJi = value; }
        }
        private string _FuKeShiJi;
        [DataMember]
        public string FuKeShiJi
        {
            get { return _FuKeShiJi; }
            set { _FuKeShiJi = value; }
        }
        private string _ZhuRenShiJi;
        [DataMember]
        public string ZhuRenShiJi
        {
            get { return _ZhuRenShiJi; }
            set { _ZhuRenShiJi = value; }
        }
        private string _FuZhuRenShiJi;
        [DataMember]
        public string FuZhuRenShiJi
        {
            get { return _FuZhuRenShiJi; }
            set { _FuZhuRenShiJi = value; }
        }
        private string _ChaoZhiQingKuang;
        [DataMember]
        public string ChaoZhiQingKuang
        {
            get { return _ChaoZhiQingKuang; }
            set { _ChaoZhiQingKuang = value; }
        }

        private string _ZhengKeChaoZhiQingKuang;
        [DataMember]
        public string ZhengKeChaoZhiQingKuang
        {
            get { return _ZhengKeChaoZhiQingKuang; }
            set { _ZhengKeChaoZhiQingKuang = value; }
        }
        private string _FuKeChaoZhiQingKuang;
        [DataMember]
        public string FuKeChaoZhiQingKuang
        {
            get { return _FuKeChaoZhiQingKuang; }
            set { _FuKeChaoZhiQingKuang = value; }
        }
        private string _ZhuRenChaoZhiQingKuang;
        [DataMember]
        public string ZhuRenChaoZhiQingKuang
        {
            get { return _ZhuRenChaoZhiQingKuang; }
            set { _ZhuRenChaoZhiQingKuang = value; }
        }
        private string _FuZhuRenChaoZhiQingKuang;
        [DataMember]
        public string FuZhuRenChaoZhiQingKuang
        {
            get { return _FuZhuRenChaoZhiQingKuang; }
            set { _FuZhuRenChaoZhiQingKuang = value; }
        }
        private string _JiGouMingChengS;
        [DataMember]
        public string JiGouMingChengS
        {
            get { return _JiGouMingChengS; }
            set { _JiGouMingChengS = value; }
        }
        #endregion
        public static BianZhiModel FillEntity(DataRow dr)
        {
            BianZhiModel right = new BianZhiModel();
            if (dr.Table != null && dr.Table.Columns.Contains("IsSelected")) right.IsSelected = dr["IsSelected"].ToString() == "false" ? false : true;
            if (dr.Table != null && dr.Table.Columns.Contains("ID") && !string.IsNullOrEmpty(dr["ID"].ToString())) right.ID = (int)dr["ID"];
            if (dr.Table != null && dr.Table.Columns.Contains("OrgID") && !string.IsNullOrEmpty(dr["OrgID"].ToString()))
            right.OrgID = (int)dr["OrgID"];
            if (dr.Table != null && dr.Table.Columns.Contains("ZongBianZhi")) right.ZongBianZhi = dr["ZongBianZhi"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeLingDao")) right.ZhengKeLingDao = dr["ZhengKeLingDao"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeLingDao"))
            {
                right.FuKeLingDao = dr["FuKeLingDao"].ToString();
                right.FuKeLingDaoS = "统筹：" + right.FuKeLingDao;
            }
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeFeiLingDao"))
            {
                right.FuKeFeiLingDao = dr["FuKeFeiLingDao"].ToString();
                right.FuKeFeiLingDaoS = "统筹：" + right.FuKeFeiLingDao;
            }
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeFeiLingDao")) right.ZhengKeFeiLingDao = dr["ZhengKeFeiLingDao"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("KeYuan")) right.KeYuan = dr["KeYuan"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("OrgName")) right.OrgName = dr["OrgName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("TCMC")) right.TCMC = dr["TCMC"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("TCMC1")) right.TCMC1 = dr["TCMC1"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ChuJiRenShu")) right.ChuJiRenShu = dr["ChuJiRenShu"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("KeYiXiaRenShu")) right.KeYiXiaRenShu = dr["KeYiXiaRenShu"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeLingDaoShiYou")) right.ZhengKeLingDaoShiYou = string.IsNullOrEmpty(dr["ZhengKeLingDaoShiYou"].ToString()) ? "0" : dr["ZhengKeLingDaoShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeLingDaoShiYou")) right.FuKeLingDaoShiYou = string.IsNullOrEmpty(dr["FuKeLingDaoShiYou"].ToString()) ? "0" : dr["FuKeLingDaoShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeFeiLingDaoShiYou")) right.FuKeFeiLingDaoShiYou = string.IsNullOrEmpty(dr["FuKeFeiLingDaoShiYou"].ToString()) ? "0" : dr["FuKeFeiLingDaoShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeFeiLingDaoShiYou")) right.ZhengKeFeiLingDaoShiYou = string.IsNullOrEmpty(dr["ZhengKeFeiLingDaoShiYou"].ToString()) ? "0" : dr["ZhengKeFeiLingDaoShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JiGuanXingZheng")) right.JiGuanXingZheng = dr["JiGuanXingZheng"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengFaXingZheng")) right.ZhengFaXingZheng = dr["ZhengFaXingZheng"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("CanZhaoGuanLi")) right.CanZhaoGuanLi = dr["CanZhaoGuanLi"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JiGouMingCheng")) right.JiGouMingCheng = dr["JiGouMingCheng"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeLingDaoTC")) if (!string.IsNullOrEmpty(dr["ZhengKeLingDaoTC"].ToString())) right.ZhengKeLingDaoTC = Convert.ToBoolean(dr["ZhengKeLingDaoTC"]);
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeFeiLingDaoTC")) if (!string.IsNullOrEmpty(dr["ZhengKeFeiLingDaoTC"].ToString())) right.ZhengKeFeiLingDaoTC = Convert.ToBoolean(dr["ZhengKeFeiLingDaoTC"]);
            if (dr.Table != null && dr.Table.Columns.Contains("QingKuangMiaoShu")) right.QingKuangMiaoShu = dr["QingKuangMiaoShu"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("ZongShu")) right.ZongShu = string.IsNullOrEmpty(dr["ZongShu"].ToString()) ? "0" : dr["ZongShu"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JuXianChu")) right.JuXianChu = string.IsNullOrEmpty(dr["JuXianChu"].ToString()) ? "0" : dr["JuXianChu"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("XiangKeZhengFuZ")) right.XiangKeZhengFuZ = string.IsNullOrEmpty(dr["XiangKeZhengFuZ"].ToString()) ? "0" : dr["XiangKeZhengFuZ"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("KeYuanShiYou")) right.KeYuanShiYou = string.IsNullOrEmpty(dr["KeYuanShiYou"].ToString()) ? "0" : dr["KeYuanShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("WeiDingZhiShiYou")) right.WeiDingZhi = string.IsNullOrEmpty(dr["WeiDingZhiShiYou"].ToString()) ? "0" : dr["WeiDingZhiShiYou"].ToString();
            if (right.ZhengKeLingDaoTC == true)
            {
                right.ZhengKeLingDaoString = right.TCMC;
            }
            else right.ZhengKeLingDaoString = right.ZhengKeLingDao;

            if (right.ZhengKeFeiLingDaoTC == true)
            {
                right.ZhengKeFeiLingDaoString = right.TCMC1;
            }
            else right.ZhengKeFeiLingDaoString = right.ZhengKeFeiLingDao;
            #region 新
            if (dr.Table != null && dr.Table.Columns.Contains("canzhaocount")) right.canzhaocount = string.IsNullOrEmpty(dr["canzhaocount"].ToString()) ? "0" : dr["canzhaocount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("xingzhengcount")) right.xingzhengcount = string.IsNullOrEmpty(dr["xingzhengcount"].ToString()) ? "0" : dr["xingzhengcount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("zhengfacount")) right.zhengfacount = string.IsNullOrEmpty(dr["zhengfacount"].ToString()) ? "0" : dr["zhengfacount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("chujicount")) right.chujicount = string.IsNullOrEmpty(dr["chujicount"].ToString()) ? "0" : dr["chujicount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("kejicount")) right.kejicount = string.IsNullOrEmpty(dr["kejicount"].ToString()) ? "0" : dr["kejicount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("keyuancount")) right.keyuancount = string.IsNullOrEmpty(dr["keyuancount"].ToString()) ? "0" : dr["keyuancount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("weidingjicount")) right.weidingjicount = string.IsNullOrEmpty(dr["weidingjicount"].ToString()) ? "0" : dr["weidingjicount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("weiguoducount")) right.weiguoducount = string.IsNullOrEmpty(dr["weiguoducount"].ToString()) ? "0" : dr["weiguoducount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("zongcount")) right.zongcount = string.IsNullOrEmpty(dr["zongcount"].ToString()) ? "0" : dr["zongcount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("chaobian")) right.chaobian = string.IsNullOrEmpty(dr["chaobian"].ToString()) ? "0" : dr["chaobian"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("kongbian")) right.kongbian = string.IsNullOrEmpty(dr["kongbian"].ToString()) ? "0" : dr["kongbian"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("kongbianlv")) right.kongbianlv = string.IsNullOrEmpty(dr["kongbianlv"].ToString()) ? "0" : dr["kongbianlv"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("canzhaoshiyoucount")) right.canzhaoshiyoucount = string.IsNullOrEmpty(dr["canzhaoshiyoucount"].ToString()) ? "0" : dr["canzhaoshiyoucount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeJieYongQingKuang")) right.ZhengKeJieYongQingKuang = string.IsNullOrEmpty(dr["ZhengKeJieYongQingKuang"].ToString()) ? "无" : dr["ZhengKeJieYongQingKuang"].ToString();
            if (right.JiGouMingCheng == "合计") right.ZhengKeJieYongQingKuang = null;
            if (dr.Table != null && dr.Table.Columns.Contains("IsZhengKeTongKeShiJieYong")) 
                if (!string.IsNullOrEmpty(dr["IsZhengKeTongKeShiJieYong"].ToString())) 
                    right.IsZhengKeTongKeShiJieYong = Convert.ToBoolean(dr["IsZhengKeTongKeShiJieYong"]);
            if (right.IsZhengKeTongKeShiJieYong == true)
            {
                right.IsZhengKeTongKeShiJieYongS = "是";
            }
            else right.IsZhengKeTongKeShiJieYongS = "否";
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeJieYongDutyID")) right.ZhengKeJieYongDutyID = dr["ZhengKeJieYongDutyID"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("FuKeJieYongQingKuang")) right.FuKeJieYongQingKuang = string.IsNullOrEmpty(dr["FuKeJieYongQingKuang"].ToString()) ? "无" : dr["FuKeJieYongQingKuang"].ToString();
            if (right.JiGouMingCheng == "合计") right.FuKeJieYongQingKuang = null;
            if (dr.Table != null && dr.Table.Columns.Contains("IsFuKeTongKeShiJieYong")) if (!string.IsNullOrEmpty(dr["IsFuKeTongKeShiJieYong"].ToString())) right.IsFuKeTongKeShiJieYong = Convert.ToBoolean(dr["IsFuKeTongKeShiJieYong"]);
            
            if (right.IsFuKeTongKeShiJieYong == true)
            {
                right.IsFuKeTongKeShiJieYongS = "是";
            }
            else right.IsFuKeTongKeShiJieYongS = "否";
            if (right.JiGouMingCheng == "合计") right.IsFuKeTongKeShiJieYongS = null;
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeJieYongDutyID")) right.FuKeJieYongDutyID = dr["FuKeJieYongDutyID"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("ZhuRenJieYongQingKuang")) right.ZhuRenJieYongQingKuang = string.IsNullOrEmpty(dr["ZhuRenJieYongQingKuang"].ToString()) ? "无" : dr["ZhuRenJieYongQingKuang"].ToString();
            if (right.JiGouMingCheng == "合计") right.ZhuRenJieYongQingKuang = null;
            if (dr.Table != null && dr.Table.Columns.Contains("ZhuRenJieYongDutyID")) right.ZhuRenJieYongDutyID = dr["ZhuRenJieYongDutyID"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuZhuRenJieYongQingKuang")) right.FuZhuRenJieYongQingKuang = string.IsNullOrEmpty(dr["FuZhuRenJieYongQingKuang"].ToString()) ? "无" : dr["FuZhuRenJieYongQingKuang"].ToString();
            if (right.JiGouMingCheng == "合计") right.FuZhuRenJieYongQingKuang = null;
            if (dr.Table != null && dr.Table.Columns.Contains("FuZhuRenJieYongDutyID")) right.FuZhuRenJieYongDutyID = dr["FuZhuRenJieYongDutyID"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("zhengkeshiyou")) if (!string.IsNullOrEmpty(dr["zhengkeshiyou"].ToString())) right.zhengkeshiyou = dr["zhengkeshiyou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("zhengkejianren")) if (!string.IsNullOrEmpty(dr["zhengkejianren"].ToString())) right.zhengkejianren = dr["zhengkejianren"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("fukeshiyou")) if (!string.IsNullOrEmpty(dr["fukeshiyou"].ToString())) right.fukeshiyou = dr["fukeshiyou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("zhurenshiyou")) if (!string.IsNullOrEmpty(dr["zhurenshiyou"].ToString())) right.zhurenshiyou = dr["zhurenshiyou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("fuzhurenshiyou")) if (!string.IsNullOrEmpty(dr["fuzhurenshiyou"].ToString())) right.fuzhurenshiyou = dr["fuzhurenshiyou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("fukejianren")) if (!string.IsNullOrEmpty(dr["fukejianren"].ToString())) right.fukejianren = dr["fukejianren"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("CanUse")) if (!string.IsNullOrEmpty(dr["CanUse"].ToString())) right.CanUse = dr["CanUse"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("Demo")) if (!string.IsNullOrEmpty(dr["Demo"].ToString())) right.Demo = dr["Demo"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JieRuJieChu")) if (!string.IsNullOrEmpty(dr["JieRuJieChu"].ToString())) right.JieRuJieChu = dr["JieRuJieChu"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeChaoZhiQingKuang")) right.ZhengKeChaoZhiQingKuang = (string.IsNullOrEmpty(dr["ZhengKeChaoZhiQingKuang"].ToString()) || dr["ZhengKeChaoZhiQingKuang"].ToString() == "0") ? "无" : dr["ZhengKeChaoZhiQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeChaoZhiQingKuang")) right.FuKeChaoZhiQingKuang = string.IsNullOrEmpty(dr["FuKeChaoZhiQingKuang"].ToString()) || dr["FuKeChaoZhiQingKuang"].ToString() == "0" ? "无" : dr["FuKeChaoZhiQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhuRenChaoZhiQingKuang")) right.ZhuRenChaoZhiQingKuang = string.IsNullOrEmpty(dr["ZhuRenChaoZhiQingKuang"].ToString()) || dr["ZhuRenChaoZhiQingKuang"].ToString() == "0" ? "无" : dr["ZhuRenChaoZhiQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuZhuRenChaoZhiQingKuang")) right.FuZhuRenChaoZhiQingKuang = string.IsNullOrEmpty(dr["FuZhuRenChaoZhiQingKuang"].ToString()) || dr["FuZhuRenChaoZhiQingKuang"].ToString() == "0" ? "无" : dr["FuZhuRenChaoZhiQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ChaoZhiQingKuang")) right.ChaoZhiQingKuang = dr["ChaoZhiQingKuang"].ToString();
            
            #endregion
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeLingDao") && dr.Table.Columns.Contains("ZhengKeJieYongQingKuang") && dr.Table.Columns.Contains("zhengkeshiyou") && dr.Table.Columns.Contains("ZhengKeChaoZhiQingKuang"))
                if (!string.IsNullOrEmpty(dr["ZhengKeLingDao"].ToString()))
                {
                    string i = string.IsNullOrEmpty(dr["ZhengKeJieYongQingKuang"].ToString())
                                   ? "0"
                                   : dr["ZhengKeJieYongQingKuang"].ToString();
                    string i1 = string.IsNullOrEmpty(dr["zhengkeshiyou"].ToString())
                                   ? "0"
                                   : dr["zhengkeshiyou"].ToString();
                    string i2 = string.IsNullOrEmpty(dr["ZhengKeChaoZhiQingKuang"].ToString())
                                   ? "0"
                                   : dr["ZhengKeChaoZhiQingKuang"].ToString();
                    right.ZhengKeShiJi = (Convert.ToInt32(dr["ZhengKeLingDao"]) + Convert.ToInt32(i) + Convert.ToInt32(i2) - Convert.ToInt32(i1)).ToString();
                }
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeFeiLingDao") && dr.Table.Columns.Contains("FuKeJieYongQingKuang") && dr.Table.Columns.Contains("FuKeChaoZhiQingKuang") && dr.Table.Columns.Contains("fukeshiyou"))
                if (!string.IsNullOrEmpty(dr["ZhengKeFeiLingDao"].ToString()))
                {
                    string i = string.IsNullOrEmpty(dr["FuKeJieYongQingKuang"].ToString())
                                   ? "0"
                                   : dr["FuKeJieYongQingKuang"].ToString();
                    string i1 = string.IsNullOrEmpty(dr["fukeshiyou"].ToString())
                                   ? "0"
                                   : dr["fukeshiyou"].ToString();
                    string i2 = string.IsNullOrEmpty(dr["FuKeChaoZhiQingKuang"].ToString())
                                   ? "0"
                                   : dr["FuKeChaoZhiQingKuang"].ToString();
                    right.FuKeShiJi = (Convert.ToInt32(dr["ZhengKeFeiLingDao"]) + Convert.ToInt32(i) + Convert.ToInt32(i2) - Convert.ToInt32(i1)).ToString();
                }
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeLingDao") && dr.Table.Columns.Contains("ZhuRenJieYongQingKuang") && dr.Table.Columns.Contains("ZhuRenChaoZhiQingKuang") && dr.Table.Columns.Contains("zhurenshiyou"))
                if (!string.IsNullOrEmpty(dr["FuKeLingDao"].ToString()))
                {
                    string i = string.IsNullOrEmpty(dr["ZhuRenJieYongQingKuang"].ToString())
                                   ? "0"
                                   : dr["ZhuRenJieYongQingKuang"].ToString();
                    string i1 = string.IsNullOrEmpty(dr["zhurenshiyou"].ToString())
                                   ? "0"
                                   : dr["zhurenshiyou"].ToString();
                    string i2 = string.IsNullOrEmpty(dr["ZhuRenChaoZhiQingKuang"].ToString())
                                   ? "0"
                                   : dr["ZhuRenChaoZhiQingKuang"].ToString();
                    right.ZhuRenShiJi = (Convert.ToInt32(dr["FuKeLingDao"]) + Convert.ToInt32(i) + Convert.ToInt32(i2) - Convert.ToInt32(i1)).ToString();
                }
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeFeiLingDao") && dr.Table.Columns.Contains("FuZhuRenJieYongQingKuang") && dr.Table.Columns.Contains("FuZhuRenChaoZhiQingKuang") && dr.Table.Columns.Contains("fuzhurenshiyou"))
                if (!string.IsNullOrEmpty(dr["FuKeFeiLingDao"].ToString()))
                {
                    string i = string.IsNullOrEmpty(dr["FuZhuRenJieYongQingKuang"].ToString())
                                   ? "0"
                                   : dr["FuZhuRenJieYongQingKuang"].ToString();
                    string i1 = string.IsNullOrEmpty(dr["fuzhurenshiyou"].ToString())
                                   ? "0"
                                   : dr["fuzhurenshiyou"].ToString();
                    string i2 = string.IsNullOrEmpty(dr["FuZhuRenChaoZhiQingKuang"].ToString())
                                   ? "0"
                                   : dr["FuZhuRenChaoZhiQingKuang"].ToString();
                    right.FuZhuRenShiJi = (Convert.ToInt32(dr["FuKeFeiLingDao"]) + Convert.ToInt32(i) + Convert.ToInt32(i2) - Convert.ToInt32(i1)).ToString();
                }
            if (right.JiGouMingCheng == "合计")
            {
                right.ZhengKeChaoZhiQingKuang = null;
                right.FuKeChaoZhiQingKuang = null;
                right.ZhuRenChaoZhiQingKuang = null;
                right.FuZhuRenChaoZhiQingKuang = null;
            }
            return right;
        }

        public static BianZhiModel FillEntity1(DataRow dr)
        {
            BianZhiModel right = new BianZhiModel();
            if (dr.Table != null && dr.Table.Columns.Contains("TCMC")) right.TCMC = dr["TCMC"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("QingKuangMiaoShu")) right.QingKuangMiaoShu = dr["QingKuangMiaoShu"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("TCMC1")) right.TCMC1 = dr["TCMC1"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("IsSelected")) right.IsSelected = dr["IsSelected"].ToString() == "false" ? false : true;
            if (dr.Table != null && dr.Table.Columns.Contains("ZongBianShiYou")) right.ZongBianZhiShiYou = string.IsNullOrEmpty(dr["ZongBianShiYou"].ToString()) ? "0" : dr["ZongBianShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeLingDaoShiYou")) right.ZhengKeLingDaoShiYou = string.IsNullOrEmpty(dr["ZhengKeLingDaoShiYou"].ToString()) ? "0" : dr["ZhengKeLingDaoShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeLingDaoShiYou")) right.FuKeLingDaoShiYou = string.IsNullOrEmpty(dr["FuKeLingDaoShiYou"].ToString()) ? "0" : dr["FuKeLingDaoShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeFeiLingDaoShiYou")) right.FuKeFeiLingDaoShiYou = string.IsNullOrEmpty(dr["FuKeFeiLingDaoShiYou"].ToString()) ? "0" : dr["FuKeFeiLingDaoShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeFeiLingDaoShiYou")) right.ZhengKeFeiLingDaoShiYou = string.IsNullOrEmpty(dr["ZhengKeFeiLingDaoShiYou"].ToString()) ? "0" : dr["ZhengKeFeiLingDaoShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("KeYuanShiYou")) right.KeYuanShiYou = string.IsNullOrEmpty(dr["KeYuanShiYou"].ToString()) ? "0" : dr["KeYuanShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("WeiDingZhiShiYou")) right.WeiDingZhi = string.IsNullOrEmpty(dr["WeiDingZhiShiYou"].ToString()) ? "0" : dr["WeiDingZhiShiYou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("OrgName")) right.OrgName = dr["OrgName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZongBianZhi")) right.ZongBianZhi = dr["ZongBianZhi"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JiGuanXingZheng")) right.JiGuanXingZheng = dr["JiGuanXingZheng"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengFaXingZheng")) right.ZhengFaXingZheng = dr["ZhengFaXingZheng"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("CanZhaoGuanLi")) right.CanZhaoGuanLi = dr["CanZhaoGuanLi"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JiGouMingCheng")) right.JiGouMingCheng = dr["JiGouMingCheng"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ChuJiRenShu")) right.ChuJiRenShu = dr["ChuJiRenShu"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("KeYiXiaRenShu")) right.KeYiXiaRenShu = dr["KeYiXiaRenShu"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeLingDaoTC")) if (!string.IsNullOrEmpty(dr["ZhengKeLingDaoTC"].ToString())) right.ZhengKeLingDaoTC = Convert.ToBoolean(dr["ZhengKeLingDaoTC"]);
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeFeiLingDaoTC")) if (!string.IsNullOrEmpty(dr["ZhengKeFeiLingDaoTC"].ToString())) right.ZhengKeFeiLingDaoTC = Convert.ToBoolean(dr["ZhengKeFeiLingDaoTC"]);
            if (dr.Table != null && dr.Table.Columns.Contains("ZongShu")) right.ZongShu = string.IsNullOrEmpty(dr["ZongShu"].ToString()) ? "0" : dr["ZongShu"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JuXianChu")) right.JuXianChu = string.IsNullOrEmpty(dr["JuXianChu"].ToString()) ? "0" : dr["JuXianChu"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("XiangKeZhengFuZ")) right.XiangKeZhengFuZ = string.IsNullOrEmpty(dr["XiangKeZhengFuZ"].ToString()) ? "0" : dr["XiangKeZhengFuZ"].ToString();
            if (right.ZhengKeLingDaoTC == true)
            {
                right.ZhengKeLingDaoString = right.TCMC;
            }
            else right.ZhengKeLingDaoString = right.ZhengKeLingDao;

            if (right.ZhengKeFeiLingDaoTC == true)
            {
                right.ZhengKeFeiLingDaoString = right.TCMC1;
            }
            else right.ZhengKeFeiLingDaoString = right.ZhengKeFeiLingDao;
            #region 新
            if (dr.Table != null && dr.Table.Columns.Contains("canzhaocount")) right.canzhaocount = string.IsNullOrEmpty(dr["canzhaocount"].ToString()) ? "0" : dr["canzhaocount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("xingzhengcount")) right.xingzhengcount = string.IsNullOrEmpty(dr["xingzhengcount"].ToString()) ? "0" : dr["xingzhengcount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("zhengfacount")) right.zhengfacount = string.IsNullOrEmpty(dr["zhengfacount"].ToString()) ? "0" : dr["zhengfacount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("chujicount")) right.chujicount = string.IsNullOrEmpty(dr["chujicount"].ToString()) ? "0" : dr["chujicount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("kejicount")) right.kejicount = string.IsNullOrEmpty(dr["kejicount"].ToString()) ? "0" : dr["kejicount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("keyuancount")) right.keyuancount = string.IsNullOrEmpty(dr["keyuancount"].ToString()) ? "0" : dr["keyuancount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("weidingjicount")) right.weidingjicount = string.IsNullOrEmpty(dr["weidingjicount"].ToString()) ? "0" : dr["weidingjicount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("weiguoducount")) right.weiguoducount = string.IsNullOrEmpty(dr["weiguoducount"].ToString()) ? "0" : dr["weiguoducount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("zongcount")) right.zongcount = string.IsNullOrEmpty(dr["zongcount"].ToString()) ? "0" : dr["zongcount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("chaobian")) right.chaobian = string.IsNullOrEmpty(dr["chaobian"].ToString()) ? "0" : dr["chaobian"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("kongbian")) right.kongbian = string.IsNullOrEmpty(dr["kongbian"].ToString()) ? "0" : dr["kongbian"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("kongbianlv")) right.kongbianlv = string.IsNullOrEmpty(dr["kongbianlv"].ToString()) ? "0" : dr["kongbianlv"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("canzhaoshiyoucount")) right.canzhaoshiyoucount = string.IsNullOrEmpty(dr["canzhaoshiyoucount"].ToString()) ? "0" : dr["canzhaoshiyoucount"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeJieYongQingKuang")) right.ZhengKeJieYongQingKuang = string.IsNullOrEmpty(dr["ZhengKeJieYongQingKuang"].ToString()) ? "无" : dr["ZhengKeJieYongQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("IsZhengKeTongKeShiJieYong")) if (!string.IsNullOrEmpty(dr["IsZhengKeTongKeShiJieYong"].ToString())) right.IsZhengKeTongKeShiJieYong = Convert.ToBoolean(dr["IsZhengKeTongKeShiJieYong"]);
            if (right.IsZhengKeTongKeShiJieYong == true)
            {
                right.IsZhengKeTongKeShiJieYongS = "是";
            }
            else right.IsZhengKeTongKeShiJieYongS = "否";
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeJieYongDutyID")) right.ZhengKeJieYongDutyID = dr["ZhengKeJieYongDutyID"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("FuKeJieYongQingKuang")) right.FuKeJieYongQingKuang = string.IsNullOrEmpty(dr["FuKeJieYongQingKuang"].ToString()) ? "无" : dr["FuKeJieYongQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("IsFuKeTongKeShiJieYong")) if (!string.IsNullOrEmpty(dr["IsFuKeTongKeShiJieYong"].ToString())) right.IsFuKeTongKeShiJieYong = Convert.ToBoolean(dr["IsFuKeTongKeShiJieYong"]);
            if (right.IsFuKeTongKeShiJieYong == true)
            {
                right.IsFuKeTongKeShiJieYongS = "是";
            }
            else right.IsFuKeTongKeShiJieYongS = "否";
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeJieYongDutyID")) right.FuKeJieYongDutyID = dr["FuKeJieYongDutyID"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("ZhuRenJieYongQingKuang")) right.ZhuRenJieYongQingKuang = string.IsNullOrEmpty(dr["ZhuRenJieYongQingKuang"].ToString()) ? "无" : dr["ZhuRenJieYongQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhuRenJieYongDutyID")) right.ZhuRenJieYongDutyID = dr["ZhuRenJieYongDutyID"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuZhuRenJieYongQingKuang")) right.FuZhuRenJieYongQingKuang = string.IsNullOrEmpty(dr["FuZhuRenJieYongQingKuang"].ToString()) ? "无" : dr["FuZhuRenJieYongQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuZhuRenJieYongDutyID")) right.FuZhuRenJieYongDutyID = dr["FuZhuRenJieYongDutyID"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("zhengkeshiyou")) if (!string.IsNullOrEmpty(dr["zhengkeshiyou"].ToString())) right.zhengkeshiyou = dr["zhengkeshiyou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("zhengkejianren")) if (!string.IsNullOrEmpty(dr["zhengkejianren"].ToString())) right.zhengkejianren = dr["zhengkejianren"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("fukeshiyou")) if (!string.IsNullOrEmpty(dr["fukeshiyou"].ToString())) right.fukeshiyou = dr["fukeshiyou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("zhurenshiyou")) if (!string.IsNullOrEmpty(dr["zhurenshiyou"].ToString())) right.zhurenshiyou = dr["zhurenshiyou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("fuzhurenshiyou")) if (!string.IsNullOrEmpty(dr["fuzhurenshiyou"].ToString())) right.fuzhurenshiyou = dr["fuzhurenshiyou"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("fukejianren")) if (!string.IsNullOrEmpty(dr["fukejianren"].ToString())) right.fukejianren = dr["fukejianren"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("CanUse")) if (!string.IsNullOrEmpty(dr["CanUse"].ToString())) right.CanUse = dr["CanUse"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("Demo")) if (!string.IsNullOrEmpty(dr["Demo"].ToString())) right.Demo = dr["Demo"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("JieRuJieChu")) if (!string.IsNullOrEmpty(dr["JieRuJieChu"].ToString())) right.JieRuJieChu = dr["JieRuJieChu"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeChaoZhiQingKuang")) right.ZhengKeChaoZhiQingKuang = (string.IsNullOrEmpty(dr["ZhengKeChaoZhiQingKuang"].ToString()) || dr["ZhengKeChaoZhiQingKuang"].ToString() == "0") ? "无" : dr["ZhengKeChaoZhiQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeChaoZhiQingKuang")) right.FuKeChaoZhiQingKuang = string.IsNullOrEmpty(dr["FuKeChaoZhiQingKuang"].ToString()) || dr["FuKeChaoZhiQingKuang"].ToString() == "0" ? "无" : dr["FuKeChaoZhiQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ZhuRenChaoZhiQingKuang")) right.ZhuRenChaoZhiQingKuang = string.IsNullOrEmpty(dr["ZhuRenChaoZhiQingKuang"].ToString()) || dr["ZhuRenChaoZhiQingKuang"].ToString() == "0" ? "无" : dr["ZhuRenChaoZhiQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("FuZhuRenChaoZhiQingKuang")) right.FuZhuRenChaoZhiQingKuang = string.IsNullOrEmpty(dr["FuZhuRenChaoZhiQingKuang"].ToString()) || dr["FuZhuRenChaoZhiQingKuang"].ToString() == "0" ? "无" : dr["FuZhuRenChaoZhiQingKuang"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("ChaoZhiQingKuang")) right.ChaoZhiQingKuang = dr["ChaoZhiQingKuang"].ToString();
            if (right.JiGouMingCheng == "合计")
            {
                right.ZhengKeChaoZhiQingKuang = null;
                right.FuKeChaoZhiQingKuang = null;
                right.ZhuRenChaoZhiQingKuang = null;
                right.FuZhuRenChaoZhiQingKuang = null;
            }
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeLingDao") && dr.Table.Columns.Contains("ZhengKeJieYongQingKuang") && dr.Table.Columns.Contains("zhengkeshiyou") && dr.Table.Columns.Contains("ZhengKeChaoZhiQingKuang"))
                if (!string.IsNullOrEmpty(dr["ZhengKeLingDao"].ToString()))
                {
                    string i = string.IsNullOrEmpty(dr["ZhengKeJieYongQingKuang"].ToString())
                                   ? "0"
                                   : dr["ZhengKeJieYongQingKuang"].ToString();
                    string i1 = string.IsNullOrEmpty(dr["zhengkeshiyou"].ToString())
                                   ? "0"
                                   : dr["zhengkeshiyou"].ToString();
                    string i2 = string.IsNullOrEmpty(dr["ZhengKeChaoZhiQingKuang"].ToString())
                                   ? "0"
                                   : dr["ZhengKeChaoZhiQingKuang"].ToString();
                    right.ZhengKeShiJi = (Convert.ToInt32(dr["ZhengKeLingDao"]) + Convert.ToInt32(i) + Convert.ToInt32(i2) - Convert.ToInt32(i1)).ToString();
                }
            if (dr.Table != null && dr.Table.Columns.Contains("ZhengKeFeiLingDao") && dr.Table.Columns.Contains("FuKeJieYongQingKuang") && dr.Table.Columns.Contains("FuKeChaoZhiQingKuang") && dr.Table.Columns.Contains("fukeshiyou"))
                if (!string.IsNullOrEmpty(dr["ZhengKeFeiLingDao"].ToString()))
                {
                    string i = string.IsNullOrEmpty(dr["FuKeJieYongQingKuang"].ToString())
                                   ? "0"
                                   : dr["FuKeJieYongQingKuang"].ToString();
                    string i1 = string.IsNullOrEmpty(dr["fukeshiyou"].ToString())
                                   ? "0"
                                   : dr["fukeshiyou"].ToString();
                    string i2 = string.IsNullOrEmpty(dr["FuKeChaoZhiQingKuang"].ToString())
                                   ? "0"
                                   : dr["FuKeChaoZhiQingKuang"].ToString();
                    right.FuKeShiJi = (Convert.ToInt32(dr["ZhengKeFeiLingDao"]) + Convert.ToInt32(i) + Convert.ToInt32(i2) - Convert.ToInt32(i1)).ToString();
                }
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeLingDao") && dr.Table.Columns.Contains("ZhuRenJieYongQingKuang") && dr.Table.Columns.Contains("ZhuRenChaoZhiQingKuang") && dr.Table.Columns.Contains("zhurenshiyou"))
                if (!string.IsNullOrEmpty(dr["FuKeLingDao"].ToString()))
                {
                    string i = string.IsNullOrEmpty(dr["ZhuRenJieYongQingKuang"].ToString())
                                   ? "0"
                                   : dr["ZhuRenJieYongQingKuang"].ToString();
                    string i1 = string.IsNullOrEmpty(dr["zhurenshiyou"].ToString())
                                   ? "0"
                                   : dr["zhurenshiyou"].ToString();
                    string i2 = string.IsNullOrEmpty(dr["ZhuRenChaoZhiQingKuang"].ToString())
                                   ? "0"
                                   : dr["ZhuRenChaoZhiQingKuang"].ToString();
                    right.ZhuRenShiJi = (Convert.ToInt32(dr["FuKeLingDao"]) + Convert.ToInt32(i) + Convert.ToInt32(i2) - Convert.ToInt32(i1)).ToString();
                }
            if (dr.Table != null && dr.Table.Columns.Contains("FuKeFeiLingDao") && dr.Table.Columns.Contains("FuZhuRenJieYongQingKuang") && dr.Table.Columns.Contains("FuZhuRenChaoZhiQingKuang") && dr.Table.Columns.Contains("fuzhurenshiyou"))
                if (!string.IsNullOrEmpty(dr["FuKeFeiLingDao"].ToString()))
                {
                    string i = string.IsNullOrEmpty(dr["FuZhuRenJieYongQingKuang"].ToString())
                                   ? "0"
                                   : dr["FuZhuRenJieYongQingKuang"].ToString();
                    string i1 = string.IsNullOrEmpty(dr["fuzhurenshiyou"].ToString())
                                   ? "0"
                                   : dr["fuzhurenshiyou"].ToString();
                    string i2 = string.IsNullOrEmpty(dr["FuZhuRenChaoZhiQingKuang"].ToString())
                                   ? "0"
                                   : dr["FuZhuRenChaoZhiQingKuang"].ToString();
                    right.FuZhuRenShiJi = (Convert.ToInt32(dr["FuKeFeiLingDao"]) + Convert.ToInt32(i) + Convert.ToInt32(i2) - Convert.ToInt32(i1)).ToString();
                }
            #endregion
            return right;
        }
    }
}
